<%@ page import="cn.estore.dao.CustomerDao" %><%--
  Created by IntelliJ IDEA.
  User: User
  Date: 2023/12/19
  Time: 10:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<table border="0" width="1024" align="center">
    <tr>
        <%--        顶部--%>
        <td colspan="6">
            <jsp:include page="../Common/head.jsp" flush="true"/>
        </td>
    </tr>
    <tr>
        <td width="40%" bgcolor="#F5F5F5" valign="top">
            <%--            左侧--%>
            <jsp:include page="../Common/left.jsp" flush="true"/>
        </td>
        <td width="724" align="center" valign="top" bgcolor="#FFFFFF">
            <%--            右侧--%>
            <div align="left">
                <img src="/javaweb_war/systemImages/fg_right03.jpg">
                <%--    显示商品--%>
                <%
                    CustomerDao dao = new CustomerDao();
                    String password = request.getParameter("password").trim();
                    String passwordOne = request.getParameter("passwordOne").trim();
                    Integer id = Integer.valueOf(request.getParameter("id"));

                %>
                <%
                    if (!password.equals(passwordOne)) {
                        out.println("两次密码不一致");
                %>
                <meta http-equiv="refresh" content="2;URL=<%=request.getContextPath()%>/pages/product/main.jsp">
                <%
                        return;
                    } else {
                        boolean change = dao.updatePassword(password, id);
                        if (!change) {
                            out.print("修改密码错误");
                        } else {
                            out.print("修改密码成功");
                        }
                    }%>
                <meta http-equiv="refresh" content="2;URL=<%=request.getContextPath()%>/pages/product/main.jsp">
            </div>

    <tr>

        <%--        底部--%>
        <td colspan="2">

            <jsp:include page="../Common/statusBarNavigation.jsp" flush="true"/>
        </td>
    </tr>
</table>
</body>
</html>
